#ifndef USER_THREADS_INNER_H_
#define USER_THREADS_INNER_H_

#include "user_threads.h"
#include "user_mutex.h"
#include "list.h"

/* initializes the uthreads library */
void uthread_init();

/* stops interrupts */
void uthread_lock();

/* resumes interrupts */
void uthread_unlock();

/* moves the current thread from rq to the wait_queue and context switches */
int uthread_suspend_self(list * wait_queue);

/* resume the first thread in the wait queue, and return it's id */
int uthread_resume_from_wait_queue(list * wait_queue, thread_id * resumed_thread);

/* returns the locked mutex list */
list *uthread_get_locks(thread_id tid);

#endif /* USER_THREADS_INNER_H_ */
